<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>修改客户沟通记录</title>
		 <link rel="stylesheet" href="__PUBLIC__/frame/layui/css/layui.css">
		<!--<link rel="stylesheet" href="http://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">-->
		<link rel="stylesheet" href="__PUBLIC__/frame/static/css/style.css">
	</head>
	<body>
		<a href="<?php echo U('Service/lst');?>" class="layui-btn" style="margin-top: 10px; "><i class="layui-icon">&#xe603;</i>客户列表</a>
		<a class="layui-btn btn-add btn-default" id="btn-refresh" style="margin-top: 10px;"><i class="layui-icon">&#x1002;</i></a>
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
          <legend style="font-size: 14px;">客服沟通记录修改</legend>
        </fieldset>
		<form class="layui-form" method="post" action="__SELF__">
			<input type="hidden" name="cus_id" value="{$chatInfo['cus_id']}" />
			<div class="layui-form-item layui-form-text" style="margin-top: 10px;">
				    <label class="layui-form-label">备注</label>
				    <div class="layui-input-block">
				      <textarea placeholder="请输入内容" name="content" id="chat_box" class="layui-textarea">{$chatInfo['content']}</textarea>
				    </div>
			</div>
			<div class="layui-inline">
					    <label class="layui-form-label">沟通方式</label>
					    <div class="layui-input-block">
					      <select name="type" lay-filter="aihao">
					        <option value="">请选择</option>
					        <?php foreach ($type as $k => $v){
					        	if ($v['name']==$chatInfo['type']) {
					        		$select = 'selected="selected"';
					        	}else{
					        		$select = '';
					        	}
					        	}?>

					        <option {$select} value="{$v['name']}">{$v['name']}</option>
					        <?php endforeach;?>					      
					      </select>
					    </div>
			</div>
						
			<div class="layui-form-item" style="margin-top: 10px;">
				    <div class="layui-input-block">
				      <button id="sub" type="submit" class="layui-btn bbb" lay-filter="demo1">立即提交</button>
				      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
				    </div>
			</div>
			
		</form>
		
	</body>
    <script type="text/javascript" src="__PUBLIC__/frame/layui/layui.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.all.min.js"> </script>
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/lang/zh-cn/zh-cn.js"></script>
	<script>
	layui.use(['form','jquery', 'layedit', 'laydate','upload','upload'], function(){
	  var form = layui.form
	  ,	  $ = layui.jquery
	  ,layer = layui.layer
	  ,layedit = layui.layedit
	  ,laydate = layui.laydate
	  ,upload = layui.upload;
	  //刷新按钮 
	  $('#btn-refresh').on('click', function () {
            location.reload();
      });
      	//设置UEditer 
      	UE.getEditor('chat_box', {
			"initialFrameWidth" : "100%",   // 宽
			"initialFrameHeight" : 250,      // 高
			"maximumWords" : 10000            // 最大可以输入的字符数量
		});
		// $(document).on('click','#sub',function(){
		// 	var cus_id = $("input[name=cus_id]");
		// 	var content = $("textarea[name=content]").val();
		// 	var type = $("select[name=type]").val();
		// 	if(content==''){
		// 		layer.msg("沟通类容不能为空！");
		// 		return false;
		// 	}
		// 	if(type == ''){
		// 		layer.msg("请选择沟通类型！");
		// 		return false;
		// 	}
		// 	$.post('/index.php/Hawk/Service/chatAdd',{"content":content,"type":type,"cus_id":cus_id},function(data){
		// 		console.log(data);
		// 		var obj = eval('(' + data + ')');
		// 		if(obj.code==1){
		// 			layer.msg(obj.msg);
		// 			window.location.href="/index.php/Hawk/Service/lst"; 
		// 		}else{
		// 			layer.msg(boj.msg);
		// 		}
		// 	});
		// });



	});
	
	
</script>
</html>
